home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / cmds.fmt / tr.man < prev    next >
Encoding:
Text File  |  1989-08-16  |  1.9 KB  |  67 lines

  1.  
  2.  
  3.  
  4. TR                        User Commands                        TR
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      tr - translate characters
  10.  
  11. SSYYNNOOPPSSIISS
  12.      ttrr [ --ccddss ] [ string1 [ string2 ] ]
  13.  
  14. DDEESSCCRRIIPPTTIIOONN
  15.      _T_r copies the standard input to the standard output with
  16.      substitution or deletion of selected characters.  Input
  17.      characters found in _s_t_r_i_n_g_1 are mapped into the correspond-
  18.      ing characters of _s_t_r_i_n_g_2.  When _s_t_r_i_n_g_2 is short it is pad-
  19.      ded to the length of _s_t_r_i_n_g_1 by duplicating its last charac-
  20.      ter.  Any combination of the options --ccddss may be used: --cc
  21.      complements the set of characters in _s_t_r_i_n_g_1 with respect to
  22.      the universe of characters whose ASCII codes are 01 through
  23.      0377 octal; --dd deletes all input characters in _s_t_r_i_n_g_1; --ss
  24.      squeezes all strings of repeated output characters that are
  25.      in _s_t_r_i_n_g_2 to single characters.
  26.  
  27.      In either string the notation _a--_b means a range of charac-
  28.      ters from _a to _b in increasing ASCII order.  The character
  29.      `\' followed by 1, 2 or 3 octal digits stands for the char-
  30.      acter whose ASCII code is given by those digits.  A `\' fol-
  31.      lowed by any other character stands for that character.
  32.  
  33.      The following example creates a list of all the words in
  34.      `file1' one per line in `file2', where a word is taken to be
  35.      a maximal string of alphabetics.  The second string is
  36.      quoted to protect `\' from the Shell.  012 is the ASCII code
  37.      for newline.
  38.  
  39.           tr -cs A-Za-z '\012' <file1 >file2
  40.  
  41. SSEEEE AALLSSOO
  42.      ed(1), ascii(7), expand(1)
  43.  
  44. BBUUGGSS
  45.      Won't handle ASCII NUL in _s_t_r_i_n_g_1 or _s_t_r_i_n_g_2; always deletes
  46.      NUL from input.
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63. Sprite v1.0              April 29, 1985                         1
  64.  
  65.  
  66.  
  67.